package cn.johnyu.base.controller;

import cn.johnyu.base.dao.PublisherDao;
import cn.johnyu.base.model.Publisher;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
@RestController
public class PublisherController {
    @Autowired private PublisherDao publisherDao;
    @GetMapping("/api/publishers")
    public List<Publisher> findAllPublishers(){
        return publisherDao.findAll();
    }

}
